package com.example.base.demo.configuration;

import com.example.base.demo.json.User;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.context.annotation.Configuration;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * @author TangDan
 * @version 1.0
 * @since 2023/3/9
 */

@Configuration
@ConfigurationProperties(prefix = "pearl")
public class TestProperties {


    List<User> users;

    Map<String,User> userMap;


    public Map<String, User> getUserMap() {
        return userMap;
    }

    public void setUserMap(Map<String, User> userMap) {
        this.userMap = userMap;
    }

    public List<User> getUsers() {
        return users;
    }

    public void setUsers(List<User> users) {
        this.users = users;
    }

    /**
     * URL
     */
    String url;

    /**
     * Host
     */
    String host;

    /**
     * 姓名
     */
    String username;

    /**
     * 生日
     */
    LocalDateTime birthday;

    @DeprecatedConfigurationProperty(replacement = "pearl.host", reason = "弃用原因")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public LocalDateTime getBirthday() {
        return birthday;
    }


    public void setBirthday(LocalDateTime birthday) {
        this.birthday = birthday;
    }
}
